<template>
	<view class="content">
		<!-- 顶部介绍卡 -->
		<title-card :userInfo='userInfo'></title-card>
		<!-- 切换导航栏 -->
		<view class="tabList">
			<v-tabs v-model="tabCurrent" :scroll="false" :tabs="tabList" @change="tabChange" ></v-tabs>	
		</view>
		<!-- 列表 -->
		<view class="lists" v-if="tabCurrent==0">
			<workorder-list></workorder-list>
		</view>
		<view class="lists" v-else-if="tabCurrent==1">
			<todohis></todohis>
		</view>
		<view class="lists" v-else>
			<repotworkorder ></repotworkorder>
		</view>
	</view>
</template>

<script>
	import titleCard from '@/components/TitleCard/TitleCard.vue'
	import repotworkorder from '@/pages/index/listCard/report/repotworkorder.vue'
	import todohis from '@/pages/index/listCard/todohis/todohisList.vue'
	import workorderList from '@/pages/index/listCard/workorderList/workorderList.vue'
	import {
		mapState,
		mapMutations
	} from 'vuex'
	import {
		getWordOrder,
		sceneList,
		getMyList
	} from '@/pages/api/orderp/orderp.js'
	import {
		getlistAll,
		sszzlist
	} from '@/pages/api/report/orderp.js'
	export default {
		components: {
			titleCard,
			repotworkorder,
			todohis,
			workorderList
		},
		data() {
			return {
				tabCurrent: 0,
				tabList: ['预警工单','全部预警'],
				value1: 1,
				options: {
					1: '工程渣土工单处置',
				},
				showsheet: false,
				
				orderList_: [],
				reportList_: [],
				sszzList_: [],
				pageSize_s: 10,
				length_w: 0,
				sszztype: 1,
				isDelay: '',
				downpull: []
			}
		},
		computed: {
			...mapState(['userInfo']),
			cell_item() {
				return this.tabCurrent == 0 ? '全部工单' : this.tabCurrent == 1 ? '有效' : '车辆'
			}
		},
		mounted() {
			this.getsszzlist()
		},
		methods: {
			...mapMutations('enforce_law', ['setInfoItem']),
			onBackPress(event){
				console.log(event)  
				uni.redirectTo({
					url:'/pages/index/index'
				})
			},
			tabChange(index) {
				this.tabCurrent = index
			},
			//获取追踪列表
			getsszzlist() {
				let params = {
					pageSize: this.pageSize_s,
					pageNum: 1,
					type: this.sszztype
				}
				return new Promise((resolve, reject) => {
					sszzlist(params).then(res => {

						this.sszzList_ = res.rows
						console.log(this.sszzList_, )
						resolve(res)
					}).catch(err => {
						reject(err)
					})
				})

			},
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		display: flex;
		flex-direction: column;
		background-color: #F2F3F5;
		overflow: hidden;
		height: 100vh;

		.tabList {
			height: 80rpx;
			border-bottom: .5rpx solid #DBDBDB;
		}
	}
	.lists {
		flex: 1;
		overflow: hidden;
	}
</style>
